﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ServiceModel.Syndication;
using System.Xml;

namespace Syndication_Reader
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack){
                Get_RSS();
            }
        }

        // Get RSS link
        protected void Get_RSS()
        { 
            // Get rss url
            string rss_url = @"http://thethao.vnexpress.net/rss/tin-moi-nhat.rss";
            // Read above rss
            SyndicationFeed feed = SyndicationFeed.Load(XmlReader.Create(rss_url));
            // Binding to gridview
            this.GridView1.DataSource = feed.Items;
            this.GridView1.DataBind();
        }
    }
}